function doSearch() {
	$('#tt').datagrid('load', {
		name : $('#name').val()
	});
	$('#tt').datagrid('unselectAll');
}

function formatOperation(value, row, index){
	var str = "";
	var csn = '<a href="#" onclick="configScriptNum(\'' + row.id + '\')">配置脚本执行量</a>  ';
	var addMark = '<a href="#" onclick="addMark(\'' + row.id + '\')">关联包</a>  ';
	str += csn;
	str += addMark;
    return str;
}

function formatEnable(value, row, index){
	if (row.isEnable == 1) {
		return "启用";
	} else {
		return "作废";
	}
}

function add() {
	showMyWindow('脚本库管理 |新增', '/script/addScriptRepo', 300, 200);
}

function edit() {
	var row = $('#tt').datagrid('getSelected');
	var id = row.id;
	if (row) {
		showMyWindow('脚本库管理 | 编辑', '/script/' + id + '/editScriptRepo', 300, 200);
	} else {
		showMsg(market.content.title, market.content.tips, alert);
	}
}

function addMark (id) {
	showMyWindow('脚本库管理 | 关联包', '/script/' + id + '/addMark', 800, 600);
}

function configScriptNum (id) {
	showMyWindow('脚本库管理 | 配置脚本执行量', '/script/' + id + '/configScriptNum', 800, 600);
}

